public class MainClass {

	public MainClass() {
	}

	public static void main(String[] args) {
		// MainClass mainClass = new MainClass();
		String name = "rahnar";

		int firstCharIndex = 0;
		int lastCharIndex = name.length() - 1;

		int currentIndex = firstCharIndex;
		double maxLoopIndex = lastCharIndex / 2;

		int countOfPalindromeChars = 0;

		while (currentIndex <= maxLoopIndex) {

			if (name.charAt(firstCharIndex + currentIndex) == name
					.charAt(lastCharIndex - currentIndex)) {
				countOfPalindromeChars += 1;
			}

			currentIndex++;
		}

		if (countOfPalindromeChars >= name.length() / 2)
			System.out.println("the name : " + name + " is Palindrome ");
		else
			System.out.println("the name : " + name + " is not Palindrome ");

	}
}
